<template>
  <div>
    <!-- 轮播图 -->
    <div class="mui-card">
      <div class="mui-card-content">
        <div class="mui-card-content-inner">       
         <swiper :imgList="imgList"></swiper>
        </div>
      </div>
    </div>

    <!-- 信息 -->
    <div class="mui-card">
      <div class="mui-card-header">{{goodsinfo.title}}</div>
      <div class="mui-card-content">
        <div class="mui-card-content-inner"> 
          <p class="price">
            市场价：<del>￥{{goodsinfo.sell_price}}</del>
            &nbsp;&nbsp;
            销售价：<span class="now_price">￥{{goodsinfo.market_price}}</span>
          </p>
          <p style="display:flex;height:30px;line-height:30px;">购买数量：<number v-on:numchange="numf" :maxvalue="goodsinfo.stock_quantity"></number></p>
          <p>
            <mt-button type="primary" size="small">立即购买</mt-button>
            <mt-button type="danger" size="small" @click="changeflag">加入购物车</mt-button>
          </p>
        </div>
      </div>
    </div>
    <!-- 商品销售详情 -->



  </div>
</template>

<script>
// 轮播图子组件
import swiper from "../myModules/swiper.vue";

export default {
  data() {
    return {
      id: this.$route.params.id,
      imgList: {},
      goodsList: {}
    };
  },
  components: {
    swiper
  },
  created() {
    this.getImg();
  },
  methods: {
    getImg() {
      this.$http.get("api/getthumimages/" + this.id).then(res => {
        if (res.body.status === 0) {
          this.imgList = res.body.message;
        }
      });
    },
    getGoodsList() {
      this.$http.get("api/goods/getinfo/" + this.id).then(res => {
        if (res.body.status === 0) {
          this.goodsList = res.body.message[0];
        }
      });
    }
  }
};
</script>

<style scoped lang='less'>

</style>